package com.njtoyo.taxi.admin.rest.export.simple_call;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.njtoyo.taxi.admin.mapper.master.enums.SimpleCallRideState;

public class SimpleCallRideStateConverter implements Converter<SimpleCallRideState> {
    @Override
    public Class<?> supportJavaTypeKey() {
        return SimpleCallRideState.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public WriteCellData<?> convertToExcelData(SimpleCallRideState value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return new WriteCellData(value.getDesc());
//        return new CellData(String.valueOf(value.getDesc()));

    }
}
